﻿var SkillsAssessments = function() {
    var init = function() {
        $("#AssessmentEdit").live('click', function() {
            $('.hidden').addClass('editEnable').removeClass('hidden');
            $('.skill_desc>p').addClass('hidden');
            $(this).addClass('hidden');
        });
        $("#AssessmentEditCancel").live('click', function() {
            $('.editEnable').addClass('hidden').removeClass('editEnable');
            $('#AssessmentEdit, .skill_desc>p ').removeClass('hidden');
        });
        $("#AssessmentEditSubmit").live('click', function() {
            $.post("AdminEditor/Assessment", {
                AssessmentId: $('#assessmentId').val(),
                From: $('#newFrom').val(),
                SkillDescription: $('#skillDescription').val(),
                SkillName: $('#skillName').val(),
                To: $('#newTo').val(),
                SkillId: $('#skillId').val()
            }, function() { location.reload(); });
        });
        $("input.date").datepicker({ dateFormat: "dd-mm-yy" });
    };
    return {
        init: init
    };
}();